package com.atguigu.springboot.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWordController {
    /**
     * 通过@Value注解,将配置文件注入到容器中
     */
    @Value("${person.last-name}")
    private String name;

    @RequestMapping("hello")
    public String hello(){
        return "hello "+name;
    }
}
